#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

#include "string_utilities.h"

/*
 * 
 */
int main(int argc, char** argv)
{
	string s = "  a b   ";
	string ts = "a b";
	string lts = "a b   ";
	string rts = "  a b";
	
	if (trim_left(s) != lts){ cerr << "trim_left : not working as expected" << endl; return -1;}
	if (trim_right(s) != rts){ cerr << "trim_right : not working as expected" << endl; return -1;}
	if (trim(s) != ts){ cerr << "trim : not working as expected" << endl; return -1;}

	s = "--a b---";
	lts = "a b---";
	rts = "--a b";
	if (trim_left(s,"-") != lts){ cerr << "trim_left (-) : not working as expected  " << endl; return -1;}
	if (trim_right(s,"-") != rts){ cerr << "trim_right (-) : not working as expected" << endl; return -1;}
	if (trim(s,"-") != ts){ cerr << "trim (-) : not working as expected" << endl; return -1;}
	
	cout << "trim test passed" << endl;
	
	return 0;
}

